<!DOCTYPE html>
<html lang="en" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="n1">
        <select v-model="opt">
            <option value="+">+</option>
            <option value="-">-</option>
            <option value="*">*</option>
            <option value="/">/</option>
        </select>
        <input type="text" v-model="n2">
        <input type="button" value="=" @click="cal">
        <input type="text" v-model="result">
    </div>
    <script>
        var vm=new Vue({
            el: "#app",
            data:{
                n1:0,
                n2:0,
                result:0,
                opt:'*'
            },
            methods:{
                cal(){  // 计算
                    var xxx=this.n1+""+this.opt+this.n2;
                    this.result=eval(xxx);
                }
            }
        })
    </script>
</body>
</html>